package com.macro.mall.portal.service.impl;

import com.macro.mall.portal.domain.OmsOrder;
import com.macro.mall.portal.service.OrderRepository;
import com.macro.mall.portal.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @Author：尚志豪
 * @Package：com.macro.mall.portal.service.impl
 * @Project：mall-swarm-B
 * @name：OrderServiceImpl
 * @Date：2024/11/1 21:42
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderRepository orderRepository;
    @Override
    public void saveOrder(OmsOrder order) {
        orderRepository.save(order);
    }

    @Override
    public List<OmsOrder> findAllOrders() {
        return orderRepository.findAll();
    }


    @Override
    public void deleteOrder(Long id) {
        orderRepository.deleteById(id);
    }
}
